﻿@model PagedList.IPagedList<HdipCricketClub.Models.Fixture>

@{
    ViewBag.Title = "EditScorecardList";
}

<h2>Edit Scorecard List</h2>

<fieldset>
<br />
<table>
    <tr>
        <th>
            Date:
        </th>
        <th>
            Team:
        </th>
        <th>
            Opponent:
        </th>
        <th></th>
    </tr>

@foreach (var item in Model) {
    <tr>
        <td>
            @Html.DisplayFor(modelItem => item.date)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.Team.name)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.Opponent.club_name) @Html.DisplayFor(modelItem => item.Opponent.team_name)
        </td>
        <td>
            @Html.ActionLink("Edit", "EditScorecard", new { id=item.fixture_id })
        </td>
    </tr>
}

</table>
</fieldset>
<br />
<div>
    Page @(Model.PageCount < Model.PageNumber ? 0 : Model.PageNumber)
    of @Model.PageCount

    @if (Model.HasPreviousPage)
    {
        @Html.ActionLink("<<", "EditScorecardList", new { page = 1 })
        @Html.Raw(" ");
        @Html.ActionLink("< Prev", "EditScorecardList", new { page = Model.PageNumber - 1 })
    }
    else
    {
        @:<<
        @Html.Raw(" ");
        @:< Prev              
    }

    @if (Model.HasNextPage)
    {
        @Html.ActionLink("Next >", "EditScorecardList", new { page = Model.PageNumber + 1 })
        @Html.Raw(" ");
        @Html.ActionLink(">>", "EditScorecardList", new { page = Model.PageCount })
    }
    else
    {
        @:Next >
        @Html.Raw(" ");
        @:>>              
    }
</div>